$nav_bg:                #fefefe;
$nav_border:            darken($nav_bg, 10%);
$sub_nav_bg:            darken($nav_bg, 5%);
$link_color:            $text-color;
$link_active_bg:        $sub_nav_bg;

#nav-container {
    z-index: 11; // should be highter than top header
    position: absolute;
    top: $header_height;
    bottom: 0;
    left: -220px;
    width: 220px;
    padding: 0;
    background-color: $nav_bg;
    -webkit-overflow-scrolling: touch;
    -webkit-overflow-scrolling: -blackberry-touch;
    // @include transition(left .3s ease-in-out);
    @media (min-width:$screen-sm) {
        left: 0;
    }

    ul {
        padding-left: 0;
        list-style: none;
    }
}

#nav-wrapper {
    width: 100%;
    height: 100%;
    // padding-bottom: 50px;
    border-right: 2px solid $nav_border;
}

#nav {
    padding: 0;
    -webkit-overflow-scrolling: touch;
    -webkit-overflow-scrolling: -blackberry-touch;

    >li>a>i,
    >li>a>.nav-icon {
        display: inline;
        margin-right: 6px;
        line-height: 1;
    }

    a {
        color: $link_color;
        &:hover,
        &:focus,
        &:active {
            text-decoration: none;
        }
    }

    >li {
        position: relative;
        margin: 0;
        text-align: left;
        font-weight: bold;
        // &.open {
        //     ul {
        //         display: block;
        //         opacity: 1;
        //     }
        // }
        &.open,
        &.active,
        &:hover {
            > a {
                background-color: $link_active_bg;
                > i {
                    &:before {
                        color: $reverse;
                    }
                    .icon-bg {
                        left: 0;
                    }
                }
            }
        }
        &:first-child > a {
            border-top: 0;
        }
        >a {
            position: relative;
            display: block;
            height: 50px;
            padding: 15px 15px;
            border-bottom: 1px solid $nav_border;
            @include transition( all .2s ease-in-out);

            > i {
                position: relative;
                display: block;
                float: left;
                width: 50px;
                height: 50px;
                line-height: 50px;
                border-right: 1px solid $nav_border;
                text-align: center;
                margin: -15px 10px -15px -15px;
                &:before {
                    position: relative;
                    z-index: 1;
                }
                .icon-bg {
                    position: absolute;
                    z-index: 12;
                    z-index: 0;
                    left: -47px;
                    width: 100%;
                    top: 0;
                    bottom: 0;
                    @include transition(left .2s ease-in-out);
                }
            }

            > .badge {
                position: absolute;
                top: 16px;
                right: 5px;
            }
        }


        > .icon-has-ul {
            position: absolute;
            top: 20px;
            right: 15px;
        }
    }

    // sub menu
    ul {
        background-color: $sub_nav_bg;
        display: none;

        a {
            font-size: 13px;
        }

        li {
            position: relative;
            padding: 0;
            &:hover,
            &.active {
                a {
                    background-color: darken($sub_nav_bg, 5%);
                }
            }
            &:last-child > a {
                border-bottom: 0;
            }

            > a {
                position: relative;
                display: block;
                padding: 13px 0 13px 25px;
                // border-bottom: 1px solid darken($sub_nav_bg, 5%);
                @include transition( all .2s ease-in-out);
                &:first-child {
                    border-top: none;
                }

                i.fa-caret-right {
                    margin-right: 25px;
                }

                > .badge {
                    position: absolute;
                    right: 5px;
                    top: 12px;
                }
            }
        }
    }
}